export * from './castArray'
export * from './clone'
export * from './equal'
export * from './math'
export * from './object'
export * from './type'
export * from './name'
export * from './EventEmitter'
export * from './SingletonEventEmitter'
export * from './KeyCode'
export * from './pairs'
export * from './getGlobalThis'

export function compareAndSet(a: any, b: any) {
  if (a == null || b == null) return false
  else {
    let isSame = true
    for (const key in b) {
      if (b.hasOwnProperty(key)) {
        if (a[key] != b[key]) {
          a[key] = b[key]
          isSame = false
        }
      }
    }
    return isSame
  }
}

export function compareAAndSet(a: any, b: any) {
  if (a == null || b == null) return false
  else {
    let isSame = true
    for (const key in a) {
      if (a.hasOwnProperty(key)) {
        if (a[key] != b[key]) {
          a[key] = b[key]
          isSame = false
        }
      }
    }
    return isSame
  }
}
